<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<link href="css/register.css" type="text/css" rel="stylesheet"/>
<script src="js/1.12.0-jquery.min.js"></script>
<script src="js/register.js"></script>
<body>
<div class="wrapper">
    <img src="images/big-logo.png"/>
    账号登录
</div>
<div class="account">
    <img src="images/account-bg.jpg"/>
    <div class="account-div">
        <div class="account-div-con">
			<center>
				<h2 id="nameerr" style="color:red;display:block;"></h2>
			</center>
            <form >
                <div class="form-div">
                    <label class="user" for="user"></label>
                    <input type="text" placeholder="用户名" id="user"/>
					<span id="title"></span>
                </div>
                <div class="form-div">
                    <label class="password" for="password"></label>
                    <input type="password" placeholder="密码" id="password"/>
                </div>
                <div class="form-div">
                    <label class="form-labels" for="form-labels"></label>
                    <input type="password" placeholder="确认密码" id="password2"/>
                </div>
                <div class="form-div">
                    <label class="number" for="number"></label>
                    <input type="text" placeholder="手机号码" id="number"/>
                </div>
                <div class="form-div1">
                    <div class="form-div1-con">
                        <label class="verify" for="verify"></label>
                        <input type="text" placeholder="验证码" id="verify"/>
                    </div>
                    <input type="button" value="获取验证码" class="button"/>
                </div>
                <div class="form-con">
                    <input type="checkbox" class="checkbox" id="agreeIt"/>
                    <p>我已阅读并同意<a href="javascript:;">《注册服务协议》</a></p>
                </div>
                <div class="button-con">
                    <input type="button" value="立即注册"/ id="sub" >
                </div>
            </form>
        </div>
        <div class="register-box-r">
            <div class="register-box-r-div">
                已是我们的会员！<a href="javascript:;">登录</a>
            </div>
            <p class="p">合作账号登录</p>
            <div class="imgs">
                <img src="images/login-qq.png" class="img1"/>
                <img src="images/login-weibo.png" class="img2"/>
            </div>
        </div>
    </div>
</div>
<div class="finally">
    <ul>
        <li><a href="javascript:;">关于万众</a><span>|</span></li>
        <li><a href="javascript:;">帮助中心</a><span>|</span></li>
        <li><a href="javascript:;">联系我们</a><span>|</span></li>
        <li><a href="javascript:;">免责声明</a><span>|</span></li>
    </ul>
    <dl>
        <dt>联系我们：</dt>
        <dd>Tel：010-62165778</dd>
        <dd>客服邮箱：xibu@123.com</dd>
    </dl>
    <p>Copyright © 2004-2016 万众网影 wanzhongfilm.com 版权所有 | 投资有风险，购买需谨慎</p>

</div>
		<script>
			$(function(){
				$("#sub").click(function checkuser(){
					//document.write(typeof name);
					var user=document.getElementById("user");
					if(user.value==""){
						$("#nameerr").html("用户名不能为空！");
						//alert("用户名不能为空！！");
						return false;
					}
					else{
						$("#nameerr").html("");
					}
					if(password.value==""){
						$("#nameerr").html("密码不能为空！");
						//alert("用户名不能为空！！");
						//return false;
					}
					else if($("#password").val().length<5||$("#password").val().length>10){
						$("#nameerr").html("密码长度为5-10位");
						//alert("用户名不能为空！！");
						return false;
					}
					else{
						$("#nameerr").html("");
					}
					if(password2.value!==password.value){
						$("#nameerr").html("两次密码不一样！");
						return false;
					}
					else{
						$("#nameerr").html("");
					}
					if(number.value==""){
						$("#nameerr").html("手机号不能为空！");
						return false;
					}
					else if($("#number").val().length<11||$("#number").val().length>12){
						$("#nameerr").html("手机号有11位！");
						return false;
					}
					else{
						$("#nameerr").html("");
					}
					if(verify.value==""){
						$("#nameerr").html("验证码不能为空!");
					}
					else{
						$("nameerr").html("");
					}
					var agreeIt=$("#agreeIt").is(":checked");
					if(agreeIt){
						return true;
						document.getElementById("sub").disabled = true; 
					}
					else{
						document.getElementById("sub").disabled = false;
						alert("您未同意协议");
						return false;
					}
					return false;
				})	
				$("#user").blur(function(){
					var user=$("#user").val();
					$.ajax({
					   type: "POST",
					   url: "abc.php",
					   data:// "name="+user,
						   {
							name:user,
							wew:password
						   },
					   success: function(msg){
						  if(msg==1){
							$("#nameerr").html("用户名已存在！");
						  }else{
							$("#nameerr").html("用户名不存在！");
						  }
					   }
					});
				});
			})	
		</script>

</body>
</html>